home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource2
/
sclib_1
/
1_6
/
v7n6047a.txt
< prev
next >
Wrap
Text File
|
1995-11-01
|
640b
|
38 lines
#include <stdio.h>
#include "plot.h"
#include "math.h"
main()
{
int ws,k,i;
Glimit w;
Gilimit v;
Gpoint p[4];
double theta,phi,g();
char *st;
st = "ega";
ws = 0;
theta = 0.5; phi = 0.3;
openws (ws,st);
w.xmin = -15.0; w.ymin = -5.0;
w.xmax = 15.0; w.ymax = 5.0;
v.xmin = 0; v.ymin = 0;
v.xmax = 600; v.ymax = 300;
setwindow (ws,0,&w);
setviewport (ws,0,&v);
selntran (ws,0);
setlinecolour (ws,15);
plotx (ws,g,30,theta,phi,-10.0,10.0,-10.0,10.0);
pause();
closews(ws);
}
double g(x,y)
double x,y;
{
double a,b;
a = (x != 0.0) ? (sin(x)/x):1.0;
b = (y != 0.0) ? (sin(y)/y):1.0;
return (4.0*a*b);
}